﻿using System;
using System.Collections.Generic;
using System.Web;
using umbraco.cms.businesslogic.datatype;
using umbraco.interfaces;

namespace Nibble.Umb.Locator.Datatypes.GoogleMapsGeocoder
{
    public class GoogleMapsGeocoderDataType : BaseDataType, IDataType
    {
        private IData _baseData;
        private IDataEditor _editor;
        private GoogleMapsGeocoderPrevalueEditor _prevalueEditor;

        public GoogleMapsGeocoderDataType()
        {
            this._prevalueEditor = new GoogleMapsGeocoderPrevalueEditor(this);
        }

        public override IData Data
        {
            get
            {
                if (this._baseData == null)
                {
                    this._baseData = new DefaultData(this);
                }
                return this._baseData;
            }
        }

        public override IDataEditor DataEditor
        {
            get
            {
                if (this._editor == null)
                {
                    this._editor = new GoogleMapsGeocoder(this);
                }
                return this._editor;
            }
        }

        public override string DataTypeName
        {
            get
            {
                return "Locator Geocoder";
            }
        }


        public override Guid Id
        {
            get
            {
                return new Guid("3ae2e5a1-fb4a-42d7-9b83-16ef9eda64a6");
            }
        }

        public override IDataPrevalue PrevalueEditor
        {
            get
            {
                return this._prevalueEditor;
            }
        }
    }
}
